const request = require('../utils/request')

/**
 * 获取用户信息
 * @param data
 * @returns {Promise<unknown>}
 */
export const getUserInfo = () =>request.get('/api/user')

/**
 * 修改用户头像
 * @param data
 * @returns {Promise<unknown>}
 */
export const  updateAvatar = data =>request.patch('/api/user/avatar',data)

/**
 * 修改用户密码
 * @param data
 * @return {Promise<unknown>}
 */
export const updatePassword = (data) =>request.post('/api/auth/password/update',data)
/**
 * 修改用户昵称
 * @param name
 * @return {Promise<unknown>}
 */
export const updateName = (data) =>request.put('/api/user',data)